import pandas as pd
import datetime

# 读取CSV文件
data = pd.read_csv('../csv_dir/demo_result.csv', header=0)
arr1=[]

for i in range(0, len(data)):
    row = data.iloc[i]['评论时间']
    a = int(row)
    date = datetime.datetime.utcfromtimestamp(a)
    targetDate = date.strftime("%Y-%m-%d %H:%M:%S")
    arr1.append(targetDate)


data['评论时间'] = arr1
# 保存回CSV文件
data.to_csv('../demo_result1.csv', index=False,encoding='utf_8_sig')
